package state;

import model.*;

public class OverallPriceAndMaterialListCached extends AtLeastMaterialListCached {
	
	public static OverallPriceAndMaterialListCached create (Product product, MaterialList materialList, int overallPrice){
		return new OverallPriceAndMaterialListCached(product, materialList, overallPrice);
	}

	private int overallPrice;


	private OverallPriceAndMaterialListCached (Product product, MaterialList materialList, int overallPrice){
		super(product, materialList );
		this.overallPrice = overallPrice;
	}

	
	public int getOverallPrice() {
		return this.overallPrice;
	}

	
	public void priceChange() {
		super.getProduct().setCurrentState(MaterialListCached.create(this.getProduct(), super.getMaterialList()));
	}

}
